<?php

/*
 * Author: Quan Van Sinh
 * Email : qvsinh@gmail.com
 * Mobile: 0972405165
 */

class validate {

    function validate() {
        
    }

    function email($email) {
        return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);
    }

    function isValidUrl($url) {
        $theresults = ereg("^[a-zA-Z0-9]+://[^ ]+$", $url, $trashed);
        if ($theresults) {
            return true;
        } else {
            return false;
        }
    }

}

?>
